import request from '@/utils/request'
const preUrl = '/goodType'
export default {
    get(id) {
        return request({
            url: preUrl + `/goodType/${id}`,
            method: 'get',
        })
    }, 
    gets(ids) {
        return request({
            url: preUrl + `/getTypes`,
            method: 'post',
            data: ids
        })
    },
    getLastType(){
        return request({
            url: preUrl + `/getTypeLast`,
            method: 'get',
        })
    },
    add(goodType) {
        return request({
            url: preUrl + `/addGoodType`,
            method: 'post',
            data: goodType
        })
    }, 
    update(goodType) {
        return request({
            url: preUrl + `/updateGoodType`,
            method: 'post',
            data: goodType
        })
    },
    delete(id) {
        return request({
            url: preUrl + `/deleteGoodType/${id}`,
            method: 'delete',
        })
    },
    deletes(ids) {
        return request({
            url: preUrl + `/deleteGoodTypes`,
            method: 'delete',
            data: {'id':ids}
        })
    },
    getData() {
        return request({
            url: preUrl + `/getGoodTypes`,
            method: 'post',
        })
    },
    getChildren(id) {
        return request({
            url: preUrl + `/getGoodTypesById/${id}`,
            method: 'post',
        })
    },
}
